3.285 \(\int \frac{\left (a+\frac{b}{x}\right )^n x^2}{c+d x} \, dx\)

Optimal. Leaf size=195 \[ -\frac{x \left (a+\frac{b}{x}\right )^{n+1} (2 a c+b d (1-n))}{2 a^2 d^2}+\frac{\left (a+\frac{b}{x}\right )^{n+1} \left (2 a^2 c^2-2 a b c d n-b^2 d^2 (1-n) n\right ) \, _2F_1\left (1,n+1;n+2;\frac{b}{a x}+1\right )}{2 a^3 d^3 (n+1)}-\frac{c^3 \left (a+\frac{b}{x}\right )^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{c \left (a+\frac{b}{x}\right )}{a c-b d}\right )}{d^3 (n+1) (a c-b d)}+\frac{x^2 \left (a+\frac{b}{x}\right )^{n+1}}{2 a d} \]

[Out]

-((2*a*c + b*d*(1 - n))*(a + b/x)^(1 + n)*x)/(2*a^2*d^2) + ((a + b/x)^(1 + n)*x^
2)/(2*a*d) - (c^3*(a + b/x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (c*(a + b
/x))/(a*c - b*d)])/(d^3*(a*c - b*d)*(1 + n)) + ((2*a^2*c^2 - 2*a*b*c*d*n - b^2*d
^2*(1 - n)*n)*(a + b/x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, 1 + b/(a*x)])
/(2*a^3*d^3*(1 + n))

_______________________________________________________________________________________

Rubi [A]  time = 0.598644, antiderivative size = 195, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.35 \[ -\frac{x \left (a+\frac{b}{x}\right )^{n+1} (2 a c+b d (1-n))}{2 a^2 d^2}+\frac{\left (a+\frac{b}{x}\right )^{n+1} \left (2 a^2 c^2-2 a b c d n-b^2 d^2 (1-n) n\right ) \, _2F_1\left (1,n+1;n+2;\frac{b}{a x}+1\right )}{2 a^3 d^3 (n+1)}-\frac{c^3 \left (a+\frac{b}{x}\right )^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{c \left (a+\frac{b}{x}\right )}{a c-b d}\right )}{d^3 (n+1) (a c-b d)}+\frac{x^2 \left (a+\frac{b}{x}\right )^{n+1}}{2 a d} \]

Antiderivative was successfully verified.

[In]  Int[((a + b/x)^n*x^2)/(c + d*x),x]

[Out]

-((2*a*c + b*d*(1 - n))*(a + b/x)^(1 + n)*x)/(2*a^2*d^2) + ((a + b/x)^(1 + n)*x^
2)/(2*a*d) - (c^3*(a + b/x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (c*(a + b
/x))/(a*c - b*d)])/(d^3*(a*c - b*d)*(1 + n)) + ((2*a^2*c^2 - 2*a*b*c*d*n - b^2*d
^2*(1 - n)*n)*(a + b/x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, 1 + b/(a*x)])
/(2*a^3*d^3*(1 + n))

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 123.623, size = 160, normalized size = 0.82 \[ - \frac{c^{3} \left (a + \frac{b}{x}\right )^{n + 1}{{}_{2}F_{1}\left (\begin{matrix} 1, n + 1 \\ n + 2 \end{matrix}\middle |{\frac{c \left (a + \frac{b}{x}\right )}{a c - b d}} \right )}}{d^{3} \left (n + 1\right ) \left (a c - b d\right )} + \frac{x^{2} \left (a + \frac{b}{x}\right )^{n + 1}}{2 a d} - \frac{x \left (a + \frac{b}{x}\right )^{n + 1} \left (2 a c + b d \left (- n + 1\right )\right )}{2 a^{2} d^{2}} + \frac{\left (a + \frac{b}{x}\right )^{n + 1} \left (2 a^{2} c^{2} - 2 a b c d n + b^{2} d^{2} n^{2} - b^{2} d^{2} n\right ){{}_{2}F_{1}\left (\begin{matrix} 1, n + 1 \\ n + 2 \end{matrix}\middle |{1 + \frac{b}{a x}} \right )}}{2 a^{3} d^{3} \left (n + 1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((a+b/x)**n*x**2/(d*x+c),x)

[Out]

-c**3*(a + b/x)**(n + 1)*hyper((1, n + 1), (n + 2,), c*(a + b/x)/(a*c - b*d))/(d
**3*(n + 1)*(a*c - b*d)) + x**2*(a + b/x)**(n + 1)/(2*a*d) - x*(a + b/x)**(n + 1
)*(2*a*c + b*d*(-n + 1))/(2*a**2*d**2) + (a + b/x)**(n + 1)*(2*a**2*c**2 - 2*a*b
*c*d*n + b**2*d**2*n**2 - b**2*d**2*n)*hyper((1, n + 1), (n + 2,), 1 + b/(a*x))/
(2*a**3*d**3*(n + 1))

_______________________________________________________________________________________

Mathematica [A]  time = 0.114502, size = 0, normalized size = 0. \[ \int \frac{\left (a+\frac{b}{x}\right )^n x^2}{c+d x} \, dx \]

Verification is Not applicable to the result.

[In]  Integrate[((a + b/x)^n*x^2)/(c + d*x),x]

[Out]

Integrate[((a + b/x)^n*x^2)/(c + d*x), x]

_______________________________________________________________________________________

Maple [F]  time = 0.068, size = 0, normalized size = 0. \[ \int{\frac{{x}^{2}}{dx+c} \left ( a+{\frac{b}{x}} \right ) ^{n}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((a+b/x)^n*x^2/(d*x+c),x)

[Out]

int((a+b/x)^n*x^2/(d*x+c),x)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (a + \frac{b}{x}\right )}^{n} x^{2}}{d x + c}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((a + b/x)^n*x^2/(d*x + c),x, algorithm="maxima")

[Out]

integrate((a + b/x)^n*x^2/(d*x + c), x)

_______________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \[{\rm integral}\left (\frac{x^{2} \left (\frac{a x + b}{x}\right )^{n}}{d x + c}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((a + b/x)^n*x^2/(d*x + c),x, algorithm="fricas")

[Out]

integral(x^2*((a*x + b)/x)^n/(d*x + c), x)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((a+b/x)**n*x**2/(d*x+c),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (a + \frac{b}{x}\right )}^{n} x^{2}}{d x + c}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((a + b/x)^n*x^2/(d*x + c),x, algorithm="giac")

[Out]

integrate((a + b/x)^n*x^2/(d*x + c), x)